﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Maintenance.aspx.vb" Inherits="Nokia_Smartphones.Maintenance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: large;
        }
        .style2
        {
            font-size: medium;
            width: 750px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p class="style1">
        <strong>Start A New Thread </strong>
    </p>
    <p class="style2">
        <span style="line-height: 115%; mso-fareast-font-family: &quot;Times New Roman&quot;; mso-ansi-language: EN-GB; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA">
        <em>How do you win a wider audience? Start a new thread, easy way in for people 
        to hear what you’re saying. We created a single space collecting all our user’s 
        ideas and opinions, bringing together stories from various backgrounds.</em></span></p>
    <p>
        <asp:TextBox ID="tb_Maintenance" runat="server" Height="103px" 
            TextMode="MultiLine" Width="374px"></asp:TextBox>
    &nbsp;&nbsp;&nbsp;
        <asp:Button ID="btn_Submit" runat="server" Text="Submit" />
    </p>
    <p>
        &nbsp;<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" Style="font-size: small;
                font-family: Calibri">
                <AlternatingItemTemplate>
                    <strong>Title:</strong> <a href="AddPosts.aspx?id=<%# Eval("Maintenance_ID") %>">
                        <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    </a>
                    <br />
                    <strong>Date Discussion Created:</strong>
                    <asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Eval("DateCreated") %>' />
                    <br />
                    <strong>Created by:</strong> <a href="Profile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    DiscussionID:
                    <asp:Label ID="DiscussionIDLabel1" runat="server" Text='<%# Eval("Maintenance_ID") %>' />
                    <br />
                    <strong>Title:</strong>
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <strong>Date Discussion Created:</strong>
                    <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                    <br />
                    <strong>Created by:</strong> <a href="Profile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                    <br />
                    <br />
                    </span>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <span>No data was returned.</span>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    DiscussionID:
                    <asp:Label ID="DiscussionIDLabel1" runat="server" Text='<%# Eval("Maintenance_ID") %>' />
                    <br />
                    <strong>Title:</strong>
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <strong>Date Discussion Created:</strong>
                    <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                    <br />
                    <strong>Created by:</strong> <a href="Profile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                    <br />
                    <br />
                    </span>
                </InsertItemTemplate>
                <ItemTemplate>
                    <strong>Title:</strong> <a href="AddPosts.aspx?id=<%# Eval("Maintenance_ID") %>">
                        <asp:Label ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    </a>
                    <br />
                    <strong>Date Discussion Created:</strong>
                    <asp:Label ID="DateCreatedLabel" runat="server" Text='<%# Eval("DateCreated") %>' />
                    <br />
                    <strong>Created by:</strong> <a href="Profile.aspx?Username=<%# Eval("UserName") %>">
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <br />
                    </span>
                </ItemTemplate>
                <LayoutTemplate>
                    <div id="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                        <span runat="server" id="itemPlaceholder" />
                    </div>
                    <div style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;
                        color: #000000;">
                        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <span style="background-color: #008A8C; color: #FFFFFF;">DiscussionID:
                        <asp:Label ID="DiscussionIDLabel1" runat="server" Text='<%# Eval("Maintenance_ID") %>' />
                        <br />
                        <strong>Title:</strong>
                        <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                        <br />
                        <strong>Date Discussion Created:</strong>
                        <asp:TextBox ID="DateCreatedTextBox" runat="server" Text='<%# Bind("DateCreated") %>' />
                        <br />
                        <strong>Created by:</strong>
                        <asp:TextBox ID="UserNameTextBox" runat="server" Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                        <br />
                        <br />
                    </span>
                </SelectedItemTemplate>
            </asp:ListView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PhonesConn %>" 
            ProviderName="<%$ ConnectionStrings:PhonesConn.ProviderName %>" 
            
        SelectCommand="SELECT Maintenance.Maintenance_ID, Maintenance.Title, Maintenance.DateCreated, aspnet_Users.UserName FROM (Maintenance INNER JOIN aspnet_Users ON Maintenance.UserFkID = aspnet_Users.UserId) GROUP BY Maintenance.Title, Maintenance.DateCreated, Maintenance.Maintenance_ID, aspnet_Users.UserName ORDER BY Maintenance.Maintenance_ID DESC">
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    <p>
    </p>
</asp:Content>
